{% extends "base.html" %}
{% block title %}我的书架{% endblock %}

{% block content %}
<section class="user-header">
    <div class="user-info">
        <div class="avatar">
            <i class="fas fa-user"></i>
        </div>
        <div>
            <h2>{{ username }}的书架</h2>
            <p>共 {{ books|length }} 本书</p>
        </div>
    </div>
</section>

<section class="book-section">
    <div class="book-grid">
        {% for book in books %}
        <div class="book-card">
            <div class="book-cover">
                <img src="{{ url_for('static', filename=book.image_path) }}" alt="{{ book.title }}">
            </div>
            <div class="book-info">
                <h3>{{ book.title }}</h3>
                <p class="category"><i class="fas fa-tag"></i> {{ book.category }}</p>
                <div class="book-actions">
                    <a href="{{ url_for('download', book_id=book.id) }}" class="download-btn">
                        <i class="fas fa-download"></i> 下载
                    </a>
                    <button class="read-btn">
                        <i class="fas fa-book-open"></i> 阅读
                    </button>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</section>

<section class="stats">
    <h2><i class="fas fa-chart-bar"></i> 阅读统计</h2>
    <div class="stats-grid">
        <div class="stat-card">
            <h3>阅读时间</h3>
            <p>38 小时</p>
        </div>
        <div class="stat-card">
            <h3>阅读书籍</h3>
            <p>12 本</p>
        </div>
        <div class="stat-card">
            <h3>最爱分类</h3>
            <p>科幻小说</p>
        </div>
    </div>
</section>
{% endblock %}